package cn.iocoder.yudao.module.form.service.impl;

import cn.iocoder.yudao.module.form.dataobject.FormChart;
import cn.iocoder.yudao.module.form.mysql.FormChartMapper;
import cn.iocoder.yudao.module.form.service.IFormChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 图表Service业务层处理
 *
 * @author Fan KaiXiang
 * @date 2022-08-31
 */
@Service
public class FormChartServiceImpl implements IFormChartService
{
    @Autowired
    private FormChartMapper formChartMapper;

    /**
     * 查询图表
     *
     * @param chartId 图表主键
     * @return 图表
     */
    @Override
    public FormChart selectFormChartByChartId(Long chartId)
    {
        return formChartMapper.selectFormChartByChartId(chartId);
    }

    /**
     * 查询图表列表
     *
     * @param formChart 图表
     * @return 图表
     */
    @Override
    public List<FormChart> selectFormChartList(FormChart formChart)
    {
        return formChartMapper.selectFormChartList(formChart);
    }

    /**
     * 新增图表
     *
     * @param formChart 图表
     * @return 结果
     */
    @Override
    public int insertFormChart(FormChart formChart)
    {
//        formChart.setCreateTime(DateUtils.getNowDate());
        return formChartMapper.insertFormChart(formChart);
    }

    /**
     * 修改图表
     *
     * @param formChart 图表
     * @return 结果
     */
    @Override
    public int updateFormChart(FormChart formChart)
    {
//        formChart.setUpdateTime(DateUtils.getNowDate());
        return formChartMapper.updateFormChart(formChart);
    }

    /**
     * 批量删除图表
     *
     * @param chartIds 需要删除的图表主键
     * @return 结果
     */
    @Override
    public int deleteFormChartByChartIds(Long[] chartIds)
    {
        return formChartMapper.deleteFormChartByChartIds(chartIds);
    }

    /**
     * 删除图表信息
     *
     * @param chartId 图表主键
     * @return 结果
     */
    @Override
    public int deleteFormChartByChartId(Long chartId)
    {
        return formChartMapper.deleteFormChartByChartId(chartId);
    }
}
